package com.cxx.purchasecharge.dal;

import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.cxx.purchasecharge.core.model.persistence.Authority;
import com.cxx.purchasecharge.dal.common.GenericCRUDDao;

@Transactional
public interface AuthorityDao extends GenericCRUDDao <Authority, Long>
{
    public Authority findById (long id);

    public Authority findByName (String name);

    @Query (value = "select a.system from Authority a where a.name=?1")
    public boolean isSystem (String name);

}
